<template>
  <div slot="content" style="height:auto;width: 70%;margin-left: 30px;">
    <el-row class="warp">
      <el-col :span="24" class="warp-breadcrum">
        <el-breadcrumb separator="/">
          <el-breadcrumb-item :to="{ path: '/' }"><b>首页</b></el-breadcrumb-item>
          <el-breadcrumb-item :to="{ path: '/enterprise/enterprise_list/' }">机构信息</el-breadcrumb-item>
          <el-breadcrumb-item>编辑机构信息</el-breadcrumb-item>
        </el-breadcrumb>
      </el-col>
    </el-row>
    <el-row class="warp">
      <el-steps :active="active" finish-status="success">
        <el-step title="编辑机构信息"></el-step>
        <el-step title="核验机构信息"></el-step>
        <el-step title="上传认证材料"></el-step>
        <el-step title="核验认证材料"></el-step>
        <el-step title="完成"></el-step>
      </el-steps>

    </el-row>


    <el-collapse v-model="activeNames">
      <el-collapse-item name="1" class="hide">
        <template slot="title">
          <i class="header-icon el-icon-info" style="color:lightskyblue"></i>机构信息
        </template>
        <el-row class="warp">
          <el-tabs type="border-card" ref="showTabs">
            <el-tab-pane label="基本信息" class="hide">
              <el-row class="warp">
                <el-col :span="24" class="warp-main" v-loading="loading" element-loading-text="拼命加载中">
                  <el-form :model="bizForm" :rules="rules" ref="bizForm" label-width="120px">
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="机构名称">
                          <span v-if="bizForm.enterpriseName">{{bizForm.enterpriseName}}</span>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="统一信用代码">
                          <span v-if="bizForm.enterpriseIdNbr">{{bizForm.enterpriseIdNbr}}</span>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="法人姓名">
                          <span v-if="bizForm.ownerName">{{bizForm.ownerName}}</span>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="法人身份证号">
                          <span v-if="bizForm.ownerIdNbr">{{bizForm.ownerIdNbr}}</span>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="法人手机号">
                          <span v-if="bizForm.ownerTel">{{bizForm.ownerTel}}</span>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="客户经理">
                          <span v-if="bizForm.user">{{bizForm.user.realName}}</span>
                        </el-form-item>
                      </el-col>
                    </el-row>

                    <el-row>
                      <el-col :span="24">
                        <el-form-item label="机构地址">
                          <span v-if="bizForm.address">{{bizForm.address}}</span>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  </el-form>
                </el-col>
              </el-row>
            </el-tab-pane>
            <el-tab-pane label="认证材料">
              <el-form :model="enterpriseIdentityForm" :rules="rules" ref="enterpriseIdentityForm" label-width="120px">

                <el-collapse v-model="enterpriseActiveNames">
                  <el-collapse-item name="1">
                    <template slot="title">
                      <i class="header-icon el-icon-caret-right"></i>机构材料
                    </template>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="营业执照">
                          <tg-img v-if="businessLicenceUrl" :src="businessLicenceUrl" class="avatar"></tg-img>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="开户许可证">
                          <tg-img v-if="openAcctlicenceUrl" :src="openAcctlicenceUrl" class="avatar"></tg-img>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="机构征信">
                          <el-button
                            size="mini" type="success" v-if="creditReportUrl"
                            @click="downLoadFiles(creditReportUrl)">下载
                          </el-button>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="资产负债表">
                          <el-button
                            size="mini" type="success" v-if="debtYearReportUrl"
                            @click="downLoadFiles(debtYearReportUrl)">下载
                          </el-button>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="利润表">
                          <el-button
                            size="mini" type="success" v-if="benefitYearReportUrl"
                            @click="downLoadFiles(benefitYearReportUrl)">下载
                          </el-button>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="公司章程">
                          <el-button
                            size="mini" type="success" v-if="articlesOfAssociationUrl"
                            @click="downLoadFiles(articlesOfAssociationUrl)">下载
                          </el-button>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="验资报告">
                          <el-button
                            size="mini" type="success" v-if="capitalVerifReportUrl"
                            @click="downLoadFiles(capitalVerifReportUrl)">下载
                          </el-button>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="现金流量表">
                          <el-button
                            size="mini" type="success" v-if="cashYearReportUrl"
                            @click="downLoadFiles(cashYearReportUrl)">下载
                          </el-button>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="银行流水">
                          <el-button
                            size="mini" type="success" v-if="acctStatementUrl"
                            @click="downLoadFiles(acctStatementUrl)">下载
                          </el-button>
                        </el-form-item>
                      </el-col>
                    </el-row>

                    <el-row>
                      <el-col :span="24">
                        <el-form-item label="纳税证明">
                          <tg-img v-for="item in payTaxCertUrlList " v-if="item" :src="item" class="avatarList"></tg-img>
                        </el-form-item>
                      </el-col>
                    </el-row>

                    <el-row>
                      <el-col :span="24">
                        <el-form-item label="手持身份证">
                          <tg-img v-for="item in ownerIdPhotoByHandUrlList " v-if="item" :src="item" class="avatarList"></tg-img>
                        </el-form-item>
                      </el-col>
                    </el-row>

                    <el-row>
                      <el-col :span="24">
                        <el-form-item label="经营场所照片">
                          <tg-img style="float: left;margin-left: 10px" v-for="item in businessPhotoUrlList " v-if="item" :src="item" class="avatarList"></tg-img>
                        </el-form-item>

                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="24">
                        <el-form-item label="医社保缴交证明">
                          <tg-img style="float: left;margin-left: 10px" v-for="item in payInsuranceCertUrlList " v-if="item" :src="item" class="avatarList"></tg-img>
                        </el-form-item>

                      </el-col>
                    </el-row>

                  </el-collapse-item>
                  <el-collapse-item name="2">
                    <template slot="title">
                      <i class="header-icon el-icon-caret-right"></i>法人材料
                    </template>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="法人身份证正面">
                          <tg-img v-if="ownerIdPhotoFrontUrl" :src="ownerIdPhotoFrontUrl" class="avatar"></tg-img>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="法人身份证反面">
                          <tg-img v-if="ownerIdPhotoBackUrl" :src="ownerIdPhotoBackUrl" class="avatar"></tg-img>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="法人结婚证">
                          <tg-img v-if="ownerMarriageCertUrl" :src="ownerMarriageCertUrl" class="avatar"></tg-img>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="法人征信">
                          <el-button
                            size="mini" type="success" v-if="ownerCreditReportUrl"
                            @click="downLoadFiles(ownerCreditReportUrl)">下载
                          </el-button>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="法人资产证明">
                          <el-button
                            size="mini" type="success" v-if="ownerMeansCertUrl"
                            @click="downLoadFiles(ownerMeansCertUrl)">下载
                          </el-button>
                        </el-form-item>
                      </el-col>
                    </el-row>

                  </el-collapse-item>
                  <el-collapse-item name="3">
                    <template slot="title">
                      <i class="header-icon el-icon-caret-right"></i>其他认证材料
                    </template>
                    <el-tabs type="border-card">
                      <el-tab-pane label="材料列表">
                        <el-row class="warp">
                          <el-col :span="24" class="warp-main" v-loading="loading" element-loading-text="拼命加载中">
                            <!--列表-->
                            <el-table :data="enterpriseIdentityExtVO" border highlight-current-row
                                      v-loading="loading"
                                      style="width: 100%;">
                              <el-table-column type="index" width="60">
                              </el-table-column>
                              <el-table-column prop="identityExtName" label="材料名称" min-width="160" sortable>
                              </el-table-column>
                              <el-table-column prop="createDate" label="上传时间" min-width="170" sortable>
                              </el-table-column>
                              <el-table-column property="operate" label="查看" min-width="150">
                                <template scope="scope">
                                  <el-button
                                    size="mini" type="success" v-if="scope.row.fileId"
                                    @click="downLoadFiles(scope.row.fileId)">下载
                                  </el-button>
                                  <el-button
                                    size="mini" type="danger" v-if="scope.row.fileId"
                                    @click="delEnterpirseIdentityExt(scope.row.id)">删除
                                  </el-button>
                                </template>
                              </el-table-column>
                            </el-table>
                          </el-col>
                        </el-row>
                        <el-row>
                          <el-pagination
                            @size-change="handleSizeChangeExt"
                            @current-change="handleCurrentChangeExt"
                            :current-page="pageExt.pageNumber"
                            :page-sizes="[10, 20, 50, 100]"
                            :page-size="10"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="pageExt.totalCount">
                          </el-pagination>
                        </el-row>
                      </el-tab-pane>

                    </el-tabs>

                  </el-collapse-item>
                </el-collapse>

              </el-form>
            </el-tab-pane>
          </el-tabs>
        </el-row>

      </el-collapse-item>
    </el-collapse>


    <el-card class="box-card" v-if="active==0">
      <el-row class="warp">
        <el-col :span="24" class="warp-main" v-loading="loading" element-loading-text="拼命加载中">
          <el-form :model="bizForm" :rules="rules" ref="bizForm" label-width="120px">
            <el-row>
              <el-col :span="12">
                <el-form-item label="机构名称" prop="enterpriseName">
                  <el-input size="medium" placeholder="请输入机构名称" v-model="bizForm.enterpriseName"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="统一信用代码" prop="enterpriseIdNbr">
                  <el-input size="medium" placeholder="请输入统一社会信用代码" v-model="bizForm.enterpriseIdNbr"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="法人姓名" prop="ownerName">
                  <el-input size="medium" placeholder="请输入法人姓名" v-model="bizForm.ownerName"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="法人身份证号" prop="ownerIdNbr">
                  <el-input size="medium" placeholder="请输入法人身份证号" v-model="bizForm.ownerIdNbr"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="法人手机号" prop="ownerTel">
                  <el-input size="medium" placeholder="请输入法人手机号" v-model="bizForm.ownerTel"></el-input>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="24">
                <el-form-item label="机构地址">
                  <el-input size="large" type="textarea" placeholder="请输入机构地址" v-model="bizForm.address"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </el-col>
      </el-row>
      <el-row class="warp">
        <el-col :span="24" class="warp-breadcrum">
          <div class="dialog-footer">
            <el-button size="medium" type="default" @click="$router.go(-1)">取消</el-button>
            <el-button size="medium" type="primary" @click="submitEnterpriseForm('bizForm')">保存</el-button>
          </div>
        </el-col>
      </el-row>
    </el-card>
    <el-card class="box-card" v-if="active==1">
      <el-row class="warp">
        <el-col :span="24" class="warp-breadcrum">
          <div class="dialog-footer">
            <el-button size="medium" type="default" @click="$router.go(-1)">返回</el-button>
            <el-button size="medium" type="primary"
                       v-if="active==1"
                       @click="checkEnterprise(1)">核验通过
            </el-button>
            <el-button size="medium" type="danger"
                       v-if="active==1"
                       @click="checkEnterprise(91)">核验不通过
            </el-button>

          </div>
        </el-col>
      </el-row>
    </el-card>

    <el-card class="box-card" v-if="active==2">
      <el-form :model="enterpriseIdentityForm" :rules="rules" ref="enterpriseIdentityForm" label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="营业执照">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="businessLicenceHandleSuccess"
                :before-upload="photoBeforeUpload">
                <img v-if="businessLicenceUrl" :src="businessLicenceUrl" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="开户许可证">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="openAcctlicenceHandleSuccess"
                :before-upload="photoBeforeUpload">
                <img v-if="openAcctlicenceUrl" :src="openAcctlicenceUrl" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="机构征信">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="creditReportHandleSuccess"
                :before-upload="fileBeforeUpload">

                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-button
                size="mini" type="success" v-if="creditReportUrl"
                @click="downLoadFiles(creditReportUrl)">下载
              </el-button>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="资产负债表">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="debtYearReportHandleSuccess"
                :before-upload="fileBeforeUpload">

                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-button
                size="mini" type="success" v-if="debtYearReportUrl"
                @click="downLoadFiles(debtYearReportUrl)">下载
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="利润表">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="benefitYearReportHandleSuccess"
                :before-upload="fileBeforeUpload">

                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-button
                size="mini" type="success" v-if="benefitYearReportUrl"
                @click="downLoadFiles(benefitYearReportUrl)">下载
              </el-button>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="公司章程">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="articlesOfAssociationHandleSuccess"
                :before-upload="fileBeforeUpload">

                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-button
                size="mini" type="success" v-if="articlesOfAssociationUrl"
                @click="downLoadFiles(articlesOfAssociationUrl)">下载
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="验资报告">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="capitalVerifReportHandleSuccess"
                :before-upload="fileBeforeUpload">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-button
                size="mini" type="success" v-if="capitalVerifReportUrl"
                @click="downLoadFiles(capitalVerifReportUrl)">下载
              </el-button>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="现金流量表">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="cashYearReportHandleSuccess"
                :before-upload="fileBeforeUpload">

                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-button
                size="mini" type="success" v-if="cashYearReportUrl"
                @click="downLoadFiles(cashYearReportUrl)">下载
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="银行流水">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="acctStatementHandleSuccess"
                :before-upload="fileBeforeUpload">

                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-button
                size="mini" type="success" v-if="acctStatementUrl"
                @click="downLoadFiles(acctStatementUrl)">下载
              </el-button>
            </el-form-item>

          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="纳税证明">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="payTaxCertHandleSuccess"
                :before-upload="photoBeforeUpload">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <img v-for="item in payTaxCertUrlList " v-if="item" :src="item" class="avatarList">

            </el-form-item>
          </el-col>

        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="手持身份证">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="ownerIdPhotoByHandHandleSuccess"
                :before-upload="photoBeforeUpload">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <img v-for="item in ownerIdPhotoByHandUrlList " v-if="item" :src="item" class="avatarList">

            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="经营场所照片">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="businessPhotoHandleSuccess"
                :before-upload="photoBeforeUpload">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <img v-for="item in businessPhotoUrlList " v-if="item" :src="item" class="avatarList">
            </el-form-item>

          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="医社保缴纳证明">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="payInsuranceCertHandleSuccess"
                :before-upload="photoBeforeUpload">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <img v-for="item in payInsuranceCertUrlList " v-if="item" :src="item" class="avatarList">
            </el-form-item>

          </el-col>
        </el-row>


        <el-row>
          <el-col :span="12">
            <el-form-item label="法人身份证正面">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="ownerIdPhotoFrontHandleSuccess"
                :before-upload="photoBeforeUpload">
                <img v-if="ownerIdPhotoFrontUrl" :src="ownerIdPhotoFrontUrl" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="法人身份证反面">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="ownerIdPhotoBackHandleSuccess"
                :before-upload="photoBeforeUpload">
                <img v-if="ownerIdPhotoBackUrl" :src="ownerIdPhotoBackUrl" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="法人结婚证">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="ownerMarriageCertHandleSuccess"
                :before-upload="photoBeforeUpload">
                <img v-if="ownerMarriageCertUrl" :src="ownerMarriageCertUrl" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="法人征信">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="ownerCreditReportHandleSuccess"
                :before-upload="fileBeforeUpload">

                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-button
                size="mini" type="success" v-if="ownerCreditReportUrl"
                @click="downLoadFiles(ownerCreditReportUrl)">下载
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="法人资产证明">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="ownerMeansCertHandleSuccess"
                :before-upload="fileBeforeUpload">

                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-button
                size="mini" type="success" v-if="ownerMeansCertUrl"
                @click="downLoadFiles(ownerMeansCertUrl)">下载
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="上传其他材料">
              <el-upload
                class="avatar-uploader"
                :headers="headOb"
                :action="fileActionUrl"
                :show-file-list="false"
                :on-success="otherFIlesHandleSuccess"
                :before-upload="fileBeforeUpload">

                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>

          </el-col>
        </el-row>


      </el-form>
      <el-tabs type="border-card">
        <el-tab-pane label="其他认证材料">
          <el-row class="warp">
            <el-col :span="24" class="warp-main" v-loading="loading" element-loading-text="拼命加载中">
              <!--列表-->
              <el-table :data="enterpriseIdentityExtVO" border highlight-current-row
                        v-loading="loading"
                        style="width: 100%;">
                <el-table-column type="index" width="60">
                </el-table-column>
                <el-table-column prop="identityExtName" label="材料名称" min-width="160" sortable>
                </el-table-column>
                <el-table-column prop="createDate" label="上传时间" min-width="170" sortable>
                </el-table-column>
                <el-table-column property="operate" label="查看" min-width="150">
                  <template scope="scope">
                    <el-button
                      size="mini" type="success" v-if="scope.row.fileId"
                      @click="downLoadFiles(scope.row.fileId)">下载
                    </el-button>
                    <el-button
                      size="mini" type="danger" v-if="scope.row.fileId"
                      @click="delEnterpirseIdentityExt(scope.row.id)">删除
                    </el-button>
                  </template>
                </el-table-column>
              </el-table>
            </el-col>
          </el-row>
          <el-row>
            <el-pagination
              @size-change="handleSizeChangeExt"
              @current-change="handleCurrentChangeExt"
              :current-page="pageExt.pageNumber"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="10"
              layout="total, sizes, prev, pager, next, jumper"
              :total="pageExt.totalCount">
            </el-pagination>
          </el-row>
        </el-tab-pane>

      </el-tabs>
      <el-row class="warp">
        <el-col :span="24" class="warp-breadcrum">
          <div class="dialog-footer">
            <el-button size="medium" type="default" @click="$router.go(-1)">返回</el-button>
            <el-button size="medium" type="primary" @click="finishedUpload('enterpriseIdentityForm')">上传完成
            </el-button>
          </div>
        </el-col>
      </el-row>
    </el-card>


    <el-card class="box-card" v-if="active==3">
      <el-row class="warp">
        <el-col :span="24" class="warp-breadcrum">
          <div class="dialog-footer">
            <el-button size="medium" type="default" @click="$router.go(-1)">返回</el-button>
            <el-button size="medium" type="success"
                       v-if="active==3"
                       @click="continueUploadInfos()">继续上传材料
            </el-button>
            <el-button size="medium" type="primary"
                       v-if="active==3"
                       @click="checkEnterprise(3)">认证通过
            </el-button>
            <el-button size="medium" type="danger"
                       v-if="active==3"
                       @click="checkEnterprise(92)">认证不通过
            </el-button>

          </div>
        </el-col>
      </el-row>
    </el-card>

    <el-card class="box-card" v-if="active==5" finish-status="success" process-status="success">
      <el-row class="warp">
        <el-col :span="24" class="warp-breadcrum">
          <div class="dialog-footer" style="text-align: center">
            <i style="font-size: 80px;color:green" class="el-icon-success"></i>
            <span class="success">已完成</span>
          </div>
        </el-col>
      </el-row>
      <el-row class="warp">
        <el-col :span="24" class="warp-breadcrum">
          <div class="dialog-footer">
            <el-button size="medium" type="default" @click="$router.go(-1)">返回</el-button>

          </div>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
  import bizAPI from '../../api/api_enterprise';
  import memberAPI from '../../api/api_member';
  import userAPI from '../../api/api_user';
  import enterpriseIdentityAPI from '../../api/api_enterpriseIdentity'
  import tgImg from '@/components/base/TG_IMG'
  import Vue from 'vue'

  export default {
    name: "enterprise_oper",
    components: { tgImg },
    data() {
      return {
        fileActionUrl: this.$proper.backEndUrl + '/file/uploadFile',
        headOb: {'authToken': localStorage.getItem('authToken')},
        active: 0,
        activeNames: [],
        enterpriseActiveNames: ['1', '2', '3'],
        //机构ID
        enterpriseId: '',
        filters: {
          enterpriseName: ''
        },
        businessLicenceUrl: '',
        openAcctlicenceUrl: '',
        ownerIdPhotoFrontUrl: '',
        ownerIdPhotoBackUrl: '',
        capitalVerifReportUrl: '',
        businessPhotoUrl: '',
        creditReportUrl: '',
        debtYearReportUrl: '',
        benefitYearReportUrl: '',
        cashYearReportUrl: '',
        articlesOfAssociationUrl: '',
        ownerMarriageCertUrl: '',
        acctStatementUrl: '',
        ownerCreditReportUrl: '',
        payTaxCertUrl: '',
        payInsuranceCertUrl: '',
        ownerIdPhotoByHandUrl: '',
        ownerMeansCertUrl: '',
        //机构认证信息
        enterpriseIdentityForm: {
          //机构认证信息ID
          id: -1,
          enterpriseId: '',
          businessLicence: '',
          openAcctlicence: '',
          ownerIdPhotoFront: '',
          ownerIdPhotoBack: '',
          capitalVerifReport: '',
          businessPhoto: '',
          creditReport: '',
          debtYearReport: '',
          benefitYearReport: '',
          cashYearReport: ''
        },
        //机构其他认证材料
        enterpriseIdentityExtVO: [],
        pageExt: {
          pageSize: 10,
          pageNumber: 1,
          totalCount: 0
        },
        //机构基本信息
        bizForm: {
          enterpriseName: '',
          enterpriseIdNbr: '',
          id: -1,
          ownerName: '',
          ownerIdNbr: '',
          ownerTel: '',
          address: '',
          memberId: '',
          userId: '',
          referrerId: ''
        },
        rules: {
          enterpriseName: [
            {required: true, message: '请输入机构名称', trigger: ['blur', 'change']}
          ],
          enterpriseIdNbr: [
            {required: true, message: '请输入统一社会信用代码', trigger: ['blur', 'change']}
          ],
          ownerName: [
            {required: true, message: '请输入法人姓名', trigger: ['blur', 'change']}
          ],
          ownerIdNbr: [
            {required: true, message: '请输入法人身份证号', trigger: ['blur', 'change']}
          ],
          ownerTel: [
            {required: true, message: '请输入法人手机号', trigger: ['blur', 'change']}
          ],
          memberId: [
            {required: true, message: '会员用户不能为空', trigger: ['blur', 'change']}
          ],
          enterpriseName111: [{required: true, type: 'text', message: '请输入机构名称', trigger: ['blur', 'change']}]
        },
        bizDomains: [],
        members: [],
        users: [],
        referrers: [],
        loading: true
      }
    },
    created() {
      let me = this;
      let bizId = me.$route.params.id;
      me.bizForm.id = bizId;

      if (bizId) {
        //机构基本信息修改
        bizAPI.getById({'id': bizId}).then(res => {
          me.bizForm = res.data;
          delete me.bizForm.createDate;
          delete me.bizForm.updateDate;
          me.enterpriseId = res.data.id;


          //设置会员用户
          if (me.bizForm.member && me.bizForm.member.id) {
            memberAPI.getById({'id': me.bizForm.member.id}).then(res1 => {
              me.members = [res1.data];
              me.bizForm.memberId = me.bizForm.member.id;
            })
          }
          console.log("===========================")
          console.log(me.bizForm)
          //设置客户经理
          if (me.bizForm.user && me.bizForm.user.id) {
            userAPI.getById({'id': me.bizForm.user.id}).then(res1 => {
              me.users = [res1.data];
              me.bizForm.userId = me.bizForm.user.id;
            })
          }

          //设置推荐人员
          if (me.bizForm.referrer && me.bizForm.referrer.id) {
            memberAPI.getById({'id': me.bizForm.referrer.id}).then(res1 => {
              me.referrers = [res1.data];
              me.bizForm.referrerId = me.bizForm.referrer.id;
            })
          }

          //查询机构认证信息
          me.searchEnterpriseIdentity();

          if (res.data.indentityState == 0) {
            me.active = 0;
          } else {
            me.changeTabByState(res.data.indentityState);
          }


          me.loading = false;
        });


      } else {
        me.loading = false;
      }

    },
    methods: {
      //机构基本信息 保存
      submitEnterpriseForm(formName) {
        let me = this;
        me.$refs[formName].validate((valid) => {
          if (valid) {
            bizAPI.doAddOrUpdate(me.bizForm).then(result => {
              me.$message({
                message: result.message,
                type: 'success'
              });
              if (result.code === '0000') {
                me.active = 1;
                me.enterpriseId = result.data.id;
                //查询企业认证信息
                me.searchEnterpriseIdentity()

              }

            })
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      //远程查询会员用户
      remoteMember(query) {
        let me = this;
        if (query !== '') {
          me.loading = true;
          memberAPI.qryBySelect({'query': query}).then(res => {
            me.members = res.data;
            me.loading = false;
          })

        } else {
          me.options4 = [];
        }
      },
      remoteUser(query) {
        let me = this;
        if (query !== '') {
          me.loading = true;
          userAPI.qryBySelect({'query': query}).then(res => {
            me.users = res.data;
            me.loading = false;
          })

        } else {
          me.options4 = [];
        }
      },
      remoteReferrer(query) {
        let me = this;
        if (query !== '') {
          me.loading = true;
          memberAPI.qryBySelect({'query': query}).then(res => {
            me.referrers = res.data;
            me.loading = false;
          })

        } else {
          this.options4 = [];
        }
      },
      //核验认证等，改变企业状态
      checkEnterprise(nextIndentityState) {
        let me = this;
        me.loading = true;
        let params = {
          'id': me.enterpriseId,
          'indentityState': nextIndentityState
        }
        bizAPI.changeState(params).then(result => {
          me.loading = false;
          me.$message({
            message: result.message,
            type: 'success'
          });

          me.changeTabByState(result.data.indentityState);

        })
      },

      //根据状态切换tab页
      changeTabByState(indentityState) {
        let me = this;
        //0	待核验
        //1	已核验
        //2	待认证
        //3	已认证
        //91	核验失败
        //92	认证失败
        //me.$refs.showTabs.$children[0].$el.style.display = 'none';
        if (indentityState == 0) {
          me.active = 1;

        }
        if (indentityState == 1) {
          me.active = 2;
        }
        if (indentityState == 2) {
          me.active = 3;
        }

        if (indentityState == 3) {
          me.active = 5;
        }

        if (indentityState == 91) {
          me.active = 0;
        }

        if (indentityState == 92) {
          me.active = 2;
        }
      },

      //根据企业ID获取企业认证信息
      searchEnterpriseIdentity() {
        let me = this;
        me.loading = true;
        enterpriseIdentityAPI.getByEnterpriseId({'enterpriseId': me.enterpriseId}).then(res => {
          me.enterpriseIdentityForm = res.data;
          delete this.enterpriseIdentityForm.createDate;
          me.loading = false;
          console.log(4555555555555555555);
          console.log(me.enterpriseIdentityForm);
          me.businessLicenceUrl = me.enterpriseIdentityForm.businessLicence;
          me.openAcctlicenceUrl = me.enterpriseIdentityForm.openAcctlicence;
          me.ownerIdPhotoFrontUrl = me.enterpriseIdentityForm.ownerIdPhotoFront;
          me.ownerIdPhotoBackUrl = me.enterpriseIdentityForm.ownerIdPhotoBack;
          me.capitalVerifReportUrl = me.enterpriseIdentityForm.capitalVerifReport;
          me.businessPhotoUrl = me.enterpriseIdentityForm.businessPhoto;
          me.creditReportUrl = me.enterpriseIdentityForm.creditReport;
          me.debtYearReportUrl = me.enterpriseIdentityForm.debtYearReport;
          me.benefitYearReportUrl = me.enterpriseIdentityForm.benefitYearReport;
          me.cashYearReportUrl = me.enterpriseIdentityForm.cashYearReport;
          me.articlesOfAssociationUrl = me.enterpriseIdentityForm.articlesOfAssociation;
          me.ownerMarriageCertUrl = me.enterpriseIdentityForm.ownerMarriageCert;
          me.acctStatementUrl = me.enterpriseIdentityForm.acctStatement;
          me.ownerCreditReportUrl = me.enterpriseIdentityForm.ownerCreditReport;
          me.payTaxCertUrl = me.enterpriseIdentityForm.payTaxCert;
          me.payInsuranceCertUrl = me.enterpriseIdentityForm.payInsuranceCert;
          me.ownerIdPhotoByHandUrl = me.enterpriseIdentityForm.ownerIdPhotoByHand;
          me.ownerMeansCertUrl = me.enterpriseIdentityForm.ownerMeansCert;

          //查询企业其他认证信息
          me.searchExt();
        })
      },

      //更新企业认证信息表
      updateEnterpriseIdentity(fieldName, fileldValue) {
        let me = this;
        me.loading = true;
        let params = {
          'id': me.enterpriseIdentityForm.id,
          [fieldName]: fileldValue
        };
        enterpriseIdentityAPI.doAddOrUpdate(params).then(result => {
          me.$message({
            message: result.message,
            type: 'success'
          });
          me.loading = false;
        })
      },

      //继续上传认证材料
      continueUploadInfos() {
        let me = this;
        me.active = 2;
      },

      //完成上传
      finishedUpload() {
        let me = this
        //TODO 需要校验是否上传完成
        me.checkEnterprise(2);//待认证
        me.active = 3;
      },

      //其他认证材料分页
      handleSearchExt() {
        this.pageExt.totalCount = 0;
        this.pageExt.pageNumber = 1;
        this.searchExt();
      },
      //其他认证材料获取列表
      searchExt: function () {
        let me = this;
        let params = {'enterpriseId': me.enterpriseId, 'enterpriseIdentityId': me.enterpriseIdentityForm.id};
        Object.assign(params, me.pageExt);
        console.log("enterpriseId:" + me.enterpriseId);
        console.log("enterpriseIdentityId:" + me.enterpriseIdentityForm.id);
        me.loading = true;
        enterpriseIdentityAPI.qryByPageExt(params).then(function (result) {
          me.loading = false;
          if (result) {
            me.pageExt.totalCount = result.data.totalCount;
            me.enterpriseIdentityExtVO = result.data.result;
          }
        }, function (err) {
          me.loading = false;
          my.$message.error({showClose: true, message: err.toString(), duration: 2000});
        }).catch(function (error) {
          my.loading = false;
          console.log(error);
          my.$message.error({showClose: true, message: '请求出现异常', duration: 2000});
        });
      },
      handleSizeChangeExt(pageSize) {
        this.pageExt.pageSize = pageSize;
        this.searchExt();
      },
      handleCurrentChangeExt(pageNumber) {
        this.pageExt.pageNumber = pageNumber;
        this.searchExt();
      },


      //下载
      downLoadFiles(fileId) {
        console.log(Vue.prototype.$proper.backEndUrl);
        window.location.href = Vue.prototype.$proper.backEndUrl + '/file/downLoadFile?attachId=' + fileId;
      },

      //其他材料删除
      delEnterpirseIdentityExt(bizId) {
        let me = this
        me.$confirm('此操作将删除该贷款凭证, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          enterpriseIdentityAPI.doDelExt({'id': bizId}).then(result => {
            me.$message({
              message: result.message,
              type: 'success'
            })
            me.searchExt()
          })
        }).catch(() => {
        })
      },

      // 添加成功后
      businessLicenceHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.businessLicenceUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.businessLicence = res.data.source
          this.updateEnterpriseIdentity('businessLicence', res.data.source);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },

      // 添加成功后
      openAcctlicenceHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.openAcctlicenceUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.openAcctlicence = res.data.source
          this.updateEnterpriseIdentity('openAcctlicence', res.data.source);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },

      // 添加成功后
      ownerIdPhotoFrontHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.ownerIdPhotoFrontUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.ownerIdPhotoFront = res.data.source
          this.updateEnterpriseIdentity('ownerIdPhotoFront', res.data.source);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },

      // 添加成功后
      ownerIdPhotoBackHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.ownerIdPhotoBackUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.ownerIdPhotoBack = res.data.source
          this.updateEnterpriseIdentity('ownerIdPhotoBack', res.data.source);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },


      // 添加成功后
      capitalVerifReportHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.capitalVerifReportUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.capitalVerifReport = res.data.id
          this.updateEnterpriseIdentity('capitalVerifReport', res.data.id);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },


      // 经营场所照片，多张，添加成功后
      businessPhotoHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.businessPhotoUrl = URL.createObjectURL(file.raw)
          if (this.enterpriseIdentityForm.businessPhoto) {
            this.enterpriseIdentityForm.businessPhoto += ',' + res.data.source
          } else {
            this.enterpriseIdentityForm.businessPhoto = res.data.source + ','
          }

          this.updateEnterpriseIdentity('businessPhoto', this.enterpriseIdentityForm.businessPhoto);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },

      // 医社保缴纳证明 ，多张，添加成功后
      payInsuranceCertHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.payInsuranceCert = URL.createObjectURL(file.raw)
          if (this.enterpriseIdentityForm.payInsuranceCert) {
            this.enterpriseIdentityForm.payInsuranceCert += ',' + res.data.source
          } else {
            this.enterpriseIdentityForm.payInsuranceCert = res.data.source + ','
          }

          this.updateEnterpriseIdentity('payInsuranceCert', this.enterpriseIdentityForm.payInsuranceCert);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },

      // 纳税证明，多张，添加成功后
      payTaxCertHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.payTaxCert = URL.createObjectURL(file.raw)
          if (this.enterpriseIdentityForm.payTaxCert) {
            this.enterpriseIdentityForm.payTaxCert += ',' + res.data.source
          } else {
            this.enterpriseIdentityForm.payTaxCert = res.data.source + ','
          }

          this.updateEnterpriseIdentity('payTaxCert', this.enterpriseIdentityForm.payTaxCert);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },

      //手持身份证 ，多张， 添加成功后
      ownerIdPhotoByHandHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.ownerIdPhotoByHand = URL.createObjectURL(file.raw)
          if (this.enterpriseIdentityForm.ownerIdPhotoByHand) {
            this.enterpriseIdentityForm.ownerIdPhotoByHand += ',' + res.data.source
          } else {
            this.enterpriseIdentityForm.ownerIdPhotoByHand = res.data.source + ','
          }

          this.updateEnterpriseIdentity('ownerIdPhotoByHand', this.enterpriseIdentityForm.ownerIdPhotoByHand);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },


      // 添加成功后
      creditReportHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.creditReportUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.creditReport = res.data.id
          this.updateEnterpriseIdentity('creditReport', this.enterpriseIdentityForm.creditReport);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },


      // 添加成功后
      debtYearReportHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.debtYearReportUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.debtYearReport = res.data.id
          this.updateEnterpriseIdentity('debtYearReport', this.enterpriseIdentityForm.debtYearReport);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },


      // 添加成功后
      benefitYearReportHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.benefitYearReportUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.benefitYearReport = res.data.id
          this.updateEnterpriseIdentity('benefitYearReport', this.enterpriseIdentityForm.benefitYearReport);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },


      // 添加成功后
      cashYearReportHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.cashYearReportUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.cashYearReport = res.data.id
          this.updateEnterpriseIdentity('cashYearReport', this.enterpriseIdentityForm.cashYearReport);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },


      // 公司章程添加成功后
      articlesOfAssociationHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.articlesOfAssociationUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.articlesOfAssociation = res.data.id
          this.updateEnterpriseIdentity('articlesOfAssociation', this.enterpriseIdentityForm.articlesOfAssociation);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },

      // 银行流水添加成功后
      acctStatementHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.acctStatementUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.acctStatement = res.data.id
          this.updateEnterpriseIdentity('acctStatement', res.data.id);
        } else {
          this.$alert(res.data, '提示')
        }
      },

      // 法人结婚证添加成功后
      ownerMarriageCertHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.ownerMarriageCertUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.ownerMarriageCert = res.data.source
          this.updateEnterpriseIdentity('ownerMarriageCert', res.data.source);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },


      // 法人征信添加成功后
      ownerCreditReportHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.ownerCreditReportUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.ownerCreditReport = res.data.id
          this.updateEnterpriseIdentity('ownerCreditReport', this.enterpriseIdentityForm.ownerCreditReport);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },

      // 法人资产证明添加成功后
      ownerMeansCertHandleSuccess(res, file) {
        if (res.code === '0000') {
          this.ownerMeansCertUrl = URL.createObjectURL(file.raw)
          this.enterpriseIdentityForm.ownerMeansCert = res.data.id
          this.updateEnterpriseIdentity('ownerMeansCert', this.enterpriseIdentityForm.ownerMeansCert);
          console.error(res.data)
        } else {
          this.$alert(res.data, '提示')
        }
      },


      // 添加成功后
      otherFIlesHandleSuccess(res, file) {
        let me = this;
        if (res.code === '0000') {
          me.loading = true;
          let params = {
            "enterpriseIdentityId": me.enterpriseIdentityForm.id,
            "fileId": res.data.id,
            "identityExtName": res.data.fileName
          }
          enterpriseIdentityAPI.doAddExt(params).then(result => {
            me.$message({
              message: result.message,
              type: 'success'
            });
            me.loading = false;
            //查询企业其他认证信息
            me.searchExt();
          })

        } else {
          me.$alert(res.data, '提示')
        }
      },

      photoBeforeUpload(file) {
        let type = file.type
        const isJPG = (type.indexOf('image') !== -1)
        const isLt2M = file.size / 1024 / 1024 < 2
        if (!isJPG) {
          this.$message.error('只能上传图片格式!')
        }
        if (!isLt2M) {
          this.$message.error('上传图片大小不能超过 2MB!')
        }
        return isJPG && isLt2M
      },
      fileBeforeUpload(file) {
        let type = file.type
        const isJPG = (type.indexOf('image') !== -1)
        const isLt2M = file.size / 1024 / 1024 < 2
        /*if (!isJPG) {
          this.$message.error('只能上传图片格式!')
        }*/
        if (!isLt2M) {
          this.$message.error('上传的文件大小不能超过 2MB!')
        }
        //return isJPG && isLt2M
        return isLt2M
      }


    },
    computed: {
      //经营场所照片
      businessPhotoUrlList() {
        let me = this;
        if (me.enterpriseIdentityForm && me.enterpriseIdentityForm.businessPhoto) {
          return me.enterpriseIdentityForm.businessPhoto.split(',');
        } else {
          return [];
        }
      },
      //医社保缴纳证明，图片，多张
      payInsuranceCertUrlList() {
        let me = this;
        if (me.enterpriseIdentityForm && me.enterpriseIdentityForm.payInsuranceCert) {
          return me.enterpriseIdentityForm.payInsuranceCert.split(',');
        } else {
          return [];
        }
      },
      //纳税证明，图片，多张
      payTaxCertUrlList() {
        let me = this;
        if (me.enterpriseIdentityForm && me.enterpriseIdentityForm.payTaxCert) {
          return me.enterpriseIdentityForm.payTaxCert.split(',');
        } else {
          return [];
        }
      },
      //手持身份证拍照,图片,多张
      ownerIdPhotoByHandUrlList() {
        let me = this;
        if (me.enterpriseIdentityForm && me.enterpriseIdentityForm.ownerIdPhotoByHand) {
          return me.enterpriseIdentityForm.ownerIdPhotoByHand.split(',');
        } else {
          return [];
        }
      }
    },
    mounted() {

    }
  }
</script>

<style scoped>
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }

  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }

  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 80px;
    height: 80px;
    line-height: 40px;
    text-align: center;
  }

  .avatar {
    width: 80px;
    height: 80px;
    display: block;
  }

  .avatarList {
    width: 80px;
    height: 80px;
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
  }
</style>
